#include <htc.h>
void interrupt ISR();
__CONFIG(FOSC_INTOSC & WDTE_OFF);

/* Interupt for Pressure Pad*/
/*==================================================================================================================================*/

void main(void){
	TRISB = 0b11111111; //Sets bits 7-4 of portB as inputs
	TRISA = 0b00000000;
	PORTA = 0x00;

	IOCIE = 1; // Turn on Interupt on change
	IOCBP0 = 1; //Turns on RB5 interrupt on rising and
	IOCBN0 = 1; // falling edges
	ei(); //Turn on Global Interrupts

	while(1)
	{
		SLEEP();            // Sleep untill interrupt arrives
	}
}

void interrupt ISR()
{
	if(IOCIF)
	{
		RA7 =1;
		_delay(1000000);
		RA7 =0;
		IOCBF = 0x00;
	}
}
	
	